<%@ page language="java" import="java.util.*" pageEncoding="utf-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib uri="/struts-dojo-tags" prefix="sd" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
	<sd:head/>
	<meta http-equiv=content-type
		  content="text/html; charset=UTF-8;charset=utf-8"/>
	<title>编辑团购</title>

	<link rel="stylesheet" href="../css/index.css" type="text/css" media="screen" charset="utf-8"/>
	<script type="text/javascript" src="../js/jquery-1.6.js"></script>
	<script type="text/javascript">
		$(document).ready(function() {
			$('#item_li').attr("class", "current")
		})
	</script>
</head>
<body class="newbie">
<div id="pagemasker"></div>
<div id="dialog"></div>
<div id="doc">
	<jsp:include page="../common/adminHeader.jsp"/>

	<div id="bdw" class="bdw">
		<div id="bd" class="cf">
			<div id="leader">
				<div class="dashboard" id="dashboard">
					<ul>
						<li>
							<a href="/admin/listCurrentItem.action">当前团购</a><span></span>
						</li>
						<li>
							<a href="/admin/listPastItem.action">历史团购</a><span></span>
						</li>
						<li class="current">
							<a href="#">编辑团购</a><span></span>
						</li>
					</ul>
				</div>
				<div id="content" class="clear mainwide">
					<div class="clear box">
						<div class="box-top"></div>
						<div class="box-content">
							<div class="head">
								<h2>编辑团购</h2>
							</div>
							<div class="sect">
								<s:action name="listCity" namespace="/" id="listCity"/>
								<s:action name="listCategory" namespace="/" id="listCategory"/>
								<s:action name="listMerchant" namespace="/" id="listMerchant"/>
								<s:form method="post" action="addItem" namespace="/admin" theme="simple"
										enctype="multipart/form-data">
									<div class="field">
										<label for="txt_name">商品名称</label>
										<s:textfield size="30" name="item.name" cssClass="f-input" id="txt_name"/>
										<s:fielderror cssClass="field-error">
											<s:param>item.name</s:param>
										</s:fielderror>
									</div>
									<div class="field">
										<label>城市及分类</label>
										<select style="height:25px;" name="item.city.chnName">
											<s:iterator id="city" value="#listCity.cities">
												<option><s:property value="#city.chnName"/></option>
											</s:iterator>
										</select>
										<select  style="height:25px;" name="item.category.name">
											<s:iterator id="category" value="#listCategory.categories">
												<option><s:property value="#category.name"/></option>
											</s:iterator>
										</select>
									</div>
									<div class="field">
										<label for="txt_title">团购标题</label>

										<div style="float: left;">
											<s:textarea id="txt_title" cssClass="f-textarea"
														name="item.title" rows="3" cols="45"/>
										</div>
									</div>
									<div class="field">
										<label for="txt_feature">特色</label>
										<s:textfield id="txt_feature" name="item.feature" cssClass="f-input"
													 cssStyle="height:20px"/>
									</div>

									<div class="field">
										<label for="txt_marketPrice">市场价</label>
										<s:textfield size="10" name="item.marketPrice" cssClass="tf-input"
													 cssStyle="height:20px"
													 id="txt_marketPrice"/>
										<label for="txt_groupPrice">团购价</label>
										<s:textfield size="10" name="item.groupPrice" cssClass="tf-input"
													 cssStyle="height:20px"
													 id="txt_groupPrice"/>
									</div>
									<div class="field">
										<label for="txt_minCount">最低数量</label>
										<s:textfield size="10" name="item.minCount" cssClass="tf-input"
													 cssStyle="height:20px"
													 id="txt_minCount"/>
										<label for="txt_maxCount">最高数量</label>
										<s:textfield size="10" name="item.maxCount" cssClass="tf-input"
													 cssStyle="height:20px"
													 id="txt_maxCount"/>
									</div>
									<div class="field">
										<label>开始日期</label>
										<sd:datetimepicker name="item.beginTime" value="today"
														   cssStyle="width:120px;height:20px;"
														   displayFormat="yyyy年MM月dd日" weekStartsOn="2"/>
									</div>
									<div class="field">
										<label>结束日期</label>
										<sd:datetimepicker name="item.endTime" value="today" displayFormat="yyyy年MM月dd日"
														   cssStyle="width:120px;height:20px;" weekStartsOn="2"/>
									</div>
									<div class="field">
										<label for="txt_description">商品简介</label>

										<div style="float: left;">
											<s:textarea id="txt_description" cssClass="f-textarea"
														name="item.description" rows="5" cols="45"/>
										</div>
									</div>
									<div class="field">
										<label>商户</label>
										<select class="tf-input" style="height:25px;" name="item.merchant.name">
											<s:iterator id="merchant" value="#listMerchant.merchants">
												<option><s:property value="#merchant.name"/></option>
											</s:iterator>
										</select>
									</div>
									<div class="field">
										<label>商品图片1</label>
										<img src="/getImage.action?id=${item.image1.id}"/>
									</div>
									<div class="field">
										<label>商品图片2</label>
										<img src="/getImage.action?id=${item.image2.id}"/>
									</div>
									<div class="field">
										<label>商品图片3</label>
										<img src="/getImage.action?id=${item.image3.id}"/>
									</div>
									<div class="act">
										<div class="act">
											<s:submit value="保存" name="commit" id="submit" cssClass="formbutton"/>
											<input type="button" value="返回"
												   onclick="location.href = '/admin/listCurrentItem.action'"
												   class="formbutton"/>
										</div>
									</div>
								</s:form>
							</div>
						</div>
						<div class="box-bottom"></div>
					</div>
				</div>

				<div id="sidebar">
				</div>

			</div>
		</div>
	</div>
	<jsp:include page="../common/footer.jsp"/>
</div>
</body>
</html>